/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jse;

/**
 * 代码点:Unicode标量值，一个代码点可以由多个代码单元表示
 * @author WangShuai
 */
public class CodePointValueTest {
    
    public static void main(String[] args) {
        String s = ",，；。 ？！“";
        for (int i = 0; i < s.length(); i++) {
            //codePointAt：Returns the Unicode code point at the specified index 十进制Unicode代码点
            System.out.println("AT: "+  s.charAt(i) + ":"+ s.codePointAt(i));
            //codePointBefore: Returns the character (Unicode code point) before the specified index
            //System.out.println("Before: " + s.codePointBefore(i+1));
        }
        //Length表示代码单元数，codePointCount代表代码点数 
        //\uD835\uDD6B为一个代码点，两个代码单元
        //System.out.println("Number: " + s.codePointCount(0, s.length()));
        //System.out.println(",".codePointAt(0));
    }
}
        
